import { MockMethod } from 'vite-plugin-mock';
const allHomeData = [
    {
        id: 1,
        title: 'vue',
        msg: 'vue',
    },
    {
        id: 2,
        title: 'react',
        msg: 'react',
    },
    {
        id: 3,
        title: 'java',
        msg: 'java',
    },
    {
        id: 4,
        title: 'js',
        msg: 'js',
    },
    {
        id: 5,
        title: 'nextjs',
        msg: 'nextjs',
    },
    {
        id: 6,
        title: 'nuxtjs',
        msg: 'nuxtjs',
    },
    {
        id: 7,
        title: 'flutter',
        msg: 'flutter',
    },
    {
        id: 8,
        title: 'spring',
        msg: 'spring',
    },
    {
        id: 9,
        title: 'vue',
        msg: 'vue',
    },
    {
        id: 10,
        title: 'react',
        msg: 'react',
    },
    {
        id: 11,
        title: 'java',
        msg: 'java',
    },
    {
        id: 12,
        title: 'js',
        msg: 'js',
    },
    {
        id: 13,
        title: 'nextjs',
        msg: 'nextjs',
    },
    {
        id: 14,
        title: 'nuxtjs',
        msg: 'nuxtjs',
    },
    {
        id: 15,
        title: 'flutter',
        msg: 'flutter',
    },
    {
        id: 16,
        title: 'spring',
        msg: 'spring',
    },
    {
        id: 17,
        title: 'java',
        msg: 'java',
    },
    {
        id: 18,
        title: 'js',
        msg: 'js',
    },
    {
        id: 19,
        title: 'nextjs',
        msg: 'nextjs',
    },
    {
        id: 20,
        title: 'nuxtjs',
        msg: 'nuxtjs',
    },
    {
        id: 21,
        title: 'flutter',
        msg: 'flutter',
    },
    {
        id: 22,
        title: 'spring',
        msg: 'spring',
    },
];
export default [
    {
        url: '/mock/api/homeData',
        method: 'post',
        response: ({ body }) => {
            const { pageNumber, pageSize } = body;
            const data = allHomeData.slice((pageNumber - 1) * pageSize, pageNumber * pageSize);
            return {
                code: 0,
                message: 'success',
                data: {
                    rows: data,
                    total: allHomeData.length,
                },
            };
        },
    },
] as MockMethod[];
